<?php if(!defined("PATH_HD"))exit;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link type="text/css" rel="stylesheet" href="http://localhost/company01/data/css/base.css"/>
            <link type="text/css" href="http://localhost/company01/data/ui/css/flick/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <script type="text/javascript" src="http://localhost/company01/data/ui/js/jquery-1.8.0.min.js"></script>
            <script type="text/javascript" src="http://localhost/company01/data/ui/js/jquery-ui-1.8.23.custom.min.js"></script>
            <script type="text/javascript">
                $(function(){
                    $("#tabs").tabs();
                })
            </script>
    </head>
    <body>
        <div class="path">
            <strong>您现在的位置：</strong>
            <a href="#">新闻</a><span>></span>
            <a href="#">php使用</a>
        </div>
        <div id="tabs" style="width:100%">
            <ul>
                <li><a href="#tabs-1">添加文章</a></li>
            </ul>
            <div id="tabs-1">
                <form action="http://localhost/company01/index.php/admin/news/add" method="post">
                    <table class="table2">
                        <tr>
                            <th>标题：</th>
                            <td><input type="text" name="title" style="width:360px;"/></td>
                        </tr>
                        <?php  if(@empty($_GET['catid'])){?>
                            <tr>
                                <th>发表栏目：</th>
                                <td><select name="catid">
                                        <option value="">选择栏目</option>
                                        <?php if(!empty($category)){$listCount = count($category);$list_id=0;?><?php foreach($category as $key=>$v){?>
                                            <option value="<?php echo $v['catid'];?>"><?php echo $v['html'];?>└─<?php echo $v['cname'];?></option>
                                        <?php $list_id+=1;?><?php }?><?php }?>
                                    </select></td>
                            </tr>
                        <?php }?>
                        <tr>
                            <th>来源：</th>
                            <td><input type="text" name="news_data[source]" style="width:200px;"/>
                                <select>
                                    <option value="">===选择来源===</option>
                                </select></td>
                        </tr>
                        <tr>
                            <th>缩略图：</th>
                            <td><?php $swfupload_path="http://localhost/company01/HD/org/swfupload250"?><?php $url="http://localhost/company01/index.php/admin/news/swfupload"?><?php $delurl="http://localhost/company01/index.php/admin/news/swfuploaddel"?><?php $size="2MB"?><?php $water_on="0"?><?php $upload_display_width="200"?><?php $upload_display_height="200"?><?php $imagesize=""?><?php $swfupload_size="2000000"?><?php $limit="10"?><?php $text="选择文件"?><?php $dir=""?><?php $session_name="hdsid"?><?php $session_id="d5bbo23ergfmfspbb0k7siq914"?><?php $type="*.*"?><?php $swfupload_id=isset($swfupload_id)?++$swfupload_id:0?><?php $input_hidden="thumb"?><?php if($swfupload_id==0):?>
<link href='http://localhost/company01/HD/org/swfupload250/css/default.css' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='http://localhost/company01/HD/org/swfupload250/js/handlers.js'></script>
<script type='text/javascript' src='http://localhost/company01/HD/org/swfupload250/swfupload/swfupload.js'></script>
<script type='text/javascript' src='http://localhost/company01/HD/org/swfupload250/swfupload/swfupload.queue.js'></script>
<script type='text/javascript' src='http://localhost/company01/HD/org/swfupload250/js/fileprogress.js'></script>  
  <script type='text/javascript' src='http://localhost/company01/HD/org/swfupload250/hd_set.js'></script>
<?php endif;?><script type="text/javascript">
            //向军  houdunwang.com  houdunwang@gmail.com
    if(typeof swfupload=='undefined'){
        swfupload_file=[];//记录添加或删除文件数据
    }
    $(function(){
        var swfu;
        var settings = {
            flash_url : '<?php echo $swfupload_path; ?>/swfupload/swfupload.swf',
            flash9_url : '<?php echo $swfupload_path; ?>/swfupload/swfupload_fp9.swf',
            upload_url: '<?php echo $url; ?>',
            post_params: {},//POST参数
            file_size_limit : '<?php echo $size; ?>',
            file_types : '<?php echo $type; ?>',
            file_types_description : 'Files:',
            file_upload_limit :<?php echo $limit; ?>,
            file_queue_limit : 0,
            custom_settings : {
                progressTarget : 'fsUploadProgress<?php echo $swfupload_id ?>',
                cancelButtonId : 'btnCancel'
            },
            debug: false,
            button_width: '110',
            button_height: '26',
            button_placeholder_id: 'spanButtonPlaceHolder',
            button_text: '<span class="theFont"><?php echo $text; ?></span>',
            button_text_style: '.theFont { display:block;font-size: 14;font-weight:bold;color:#ffffff; }',
            button_text_left_padding: 30,
            button_text_top_padding: 3,
            button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
            button_cursor: SWFUpload.CURSOR.HAND,
            swfupload_preload_handler : preLoad,
            swfupload_load_failed_handler : loadFailed,
            file_queued_handler : fileQueued,
            file_queue_error_handler : fileQueueError,
            file_dialog_complete_handler : fileDialogComplete,
            upload_start_handler : uploadStart,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : uploadSuccess,
            upload_complete_handler : uploadComplete,
            queue_complete_handler : queueComplete	// Queue plugin event
        };
        settings.post_params['<?php echo $session_name; ?>']='<?php echo $session_id; ?>';
        settings.post_params['dir']='<?php echo $dir; ?>';
        settings.post_params['upload_display_width']='<?php echo $upload_display_width; ?>';
        settings.post_params['upload_display_height']='<?php echo $upload_display_height; ?>';
        settings.post_params['imagesize']='<?php echo $imagesize; ?>';
        //settings.post_params['thumbon1']='< ? php echo $thumbon; ? >';
        settings.post_params['swfupload_size']='<?php echo $swfupload_size; ?>';
        settings.post_params['water_on']='<?php echo $water_on; ?>';
        swfu = new SWFUpload(settings);
        var file_upload={
            "swfuobj":swfu,//上传对象
            "file_upload_limit":swfu.settings.file_upload_limit,//允许上传的总的文件数量，删除操作不会改变
            "file_allow_total":swfu.settings.file_upload_limit,//允许上传的总的文件数量,删除操作会改变
            "file_success_nums":0,//成功上传的文件数量
            "file_nums":0,//已经上传的文件数量，包括删除的文件
            "delurl":"<?php echo $delurl; ?>",
            "input_name":"<?php echo $input_hidden;?>"
        };
        swfupload_file.push(file_upload);
    })
</script>
            <!--上传显示DIV-->
        <div class='fieldset flash' id='fsUploadProgress<?php echo $swfupload_id;?>'>
        </div>

        <div class='swfupload_button'  href='javascript:;'>
            <span id='spanButtonPlaceHolder'></span>
            <i class='ico-btn ib-upload' style='position:absolute;left:10px;top:5px;'></i>
        </div>
        <div id='swfupload_message<?php echo $swfupload_id;?>'></div>
        <div  class='swfupload_file_show' id='swfupload_file_show<?php echo $swfupload_id;?>'>
        <?php if($swfupload_id==0):?>
            <div class='swfupload_input'></div>
            <?php endif;?>
            <ul></ul>
        </div>
        </td>
                        </tr>
                        <tr>
                            <th>跳转url：</th>
                            <td><input type="text" name="gourl" style="width:260px;"/></td>
                        </tr>
                        <tr>
                            <th>关键字：</th>
                            <td><input type="text" name="keywords" style="width:300px;"/></td>
                        </tr>
                        <tr>
                            <th>描述：</th>
                            <td><textarea style="height:60px;width:90%" name="description"></textarea></td>
                        </tr>
                        <tr>
                            <th>正文：</th>
                            <td><script type="text/javascript">HD_UEDITOR_ROOT="http://localhost/company01/HD/org/ueditor/";</script><script type="text/javascript" src="http://localhost/company01/HD/org/ueditor/editor_config.js"></script>
		<script type="text/javascript" src="http://localhost/company01/HD/org/ueditor/editor_all.js"></script>
		<link rel="stylesheet" href="http://localhost/company01/HD/org/ueditor/themes/default/ueditor.css"><script type="text/plain" name="news_data[body]" id="hd_ueditor44" style='width:100%'></script><script type="text/javascript" >var editorOption = {
                        autoFloatEnabled:false,
                         
                         imageUrl:"http://localhost/company01/index.php/admin/news/editorupload",
                         imagePath:"",
                         fileUrl:"http://localhost/company01/index.php/admin/news/editorupload",
                         filePath:"",
                         maximumWords:100,
                         minFrameHeight:280
                    };var editor = new baidu.editor.ui.Editor(editorOption);
                    editor.render("hd_ueditor44")</script></td>
                        </tr>
                        <tr>
                            <th>内容页模板：</th>
                            <td><input type="text" name="news_data[template]" style="width:300px;"/></td>
                        </tr>
                        <tr>
                            <th>点击率：</th>
                            <td><input type="text" name="click" style="width:100px;" value="100"/></td>
                        </tr>
                        <tr>
                            <td>
                                <input type="submit" class="submit" value="添加文章"/>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </body>
</html>
